<!DOCTYPE>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>成都文理学院思想政治理论水平在线测试</title>
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link href="css/bootstrap.min.css" rel="stylesheet"
          type="text/css"/>
    <link href="css/theme.css" rel="stylesheet"
          type="text/css"/>
    <script src="../js/vue2.6.9.min.js"></script>
    <!--<script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->
    <script src="../js/jquery-3.3.1.js"></script>
    <style>
        .btn:hover{
            /* cursor: not-allowed !important; */
        }
    </style>
</head>
<body>
<div id="app">
    <div align="center" style="background-color: white;">
        <img src="images/logo.png"/>
    </div>
    <div style="font-size:31px;color:red;font-family:宋体;text-align:center;margin-top:10px;margin-bottom:-8px;">
        <b style="fon-size:24px; font-weight:600">{{examInfo.examName}}</b></div>
    <div class="row-fluid">
        <div class="container-fluid">
            <div class="span12 examcontent">
                <div class="exambox">
                    <div class="examform">
                        <div class="container-fluid footcontent">
                            <fieldset>
                                <legend><font color="red" size="5">考生个人信息</font>&nbsp&nbsp
                                    <a id="logout" href="" style="float: right ;cursor:pointer; position:static; margin-right: 10px;font-size: 18px;">退出登录</a>
                                </legend>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <b>学号：</b><span id="studentNo">{{studentInfo.studentNo}}</span>
                                    </div>
                                    <div class="span6">
                                        <b>姓名：</b> <span id="name">{{studentInfo.name}}</span>
                                    </div>
                                   <!-- <div class="span6">
                                        <b>性别：</b> <span id="sex">{{studentInfo.sex}}</span>
                                    </div>-->
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <b>班级：</b> <span id="clazz">{{studentInfo.clazz}}</span>
                                    </div>
                                    <div class="span6">
                                        <b>专业：</b><span id="major">{{studentInfo.major}}</span>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <b>年级：</b><span id="grade">{{studentInfo.grade}}</span>
                                    </div>
                                    <div class="span6">
                                        <b>院系：</b><span id="department">{{studentInfo.department}}</span>
                                    </div>
                                </div>
                                <!--    <div class="row-fluid">
                                        <div class="span6">

                                            <b>登陆时间：</b>&lt;!&ndash;<fmt:formatDate value="${user_in_session.lastLoginTime}"
                                                                        pattern="yyyy-MM-dd HH:mm:ss"/>&ndash;&gt;
                                        </div>
                                        <div class="span6">
                                            <b>登陆IP：</b> ${user_in_session.lastLoginIp}
                                        </div>
                                    </div>-->
                                <div class="row-fluid">
                                    <div class="span6">
                                        <b>是否毕业：</b><span id="graduated">{{studentInfo.graduated}}</span>
                                    </div>
                                    <!--<div class="span6">
                                        <b>优秀学员：</b><span id="excellent">{{studentInfo.excellent}}</span>
                                    </div>-->
                                    <div class="span6">
                                        <b>党校号：</b><span id="excellent">{{studentInfo.partyNumber}}</span>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <!-- <div class="span12">
                                         <b>备注：</b>${user_in_session.excellent}
                                     </div>-->
                                </div>
                            </fieldset>

                            <br/>
                            <fieldset>
                                <legend><font color="red" size="5">考生个人成绩</font></legend>
                                <div class="row-fluid">
                                    <div class="span12">
                                        <b>初考考试：{{studentInfo.examScore}}</b>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span12">

                                    </div>
                                </div>
                            </fieldset>
                            <br/>

                            <fieldset>
                                <legend><font color="red" size="5">考试须知</font></legend>
                                <div class="row-fluid">
                                    <div class="span12">
                                        <b>1.考试时间：{{examInfo.examTime}}分钟。<br/>
                                            2.考试题型：单选题（{{examInfo.radioScore}}分*{{examInfo.radioNum}}题）、多选题（{{examInfo.checkScore==null?0:examInfo.checkScore}}分*{{examInfo.checkNum==null?0:examInfo.checkNum}}题）、判断题
                                            （{{examInfo.judgeScore}}分*{{examInfo.judgeNum}}题）、填空题（{{examInfo.fillScore}}分*{{examInfo.fillNum}}题）及格线（{{examInfo.passScore}}分）。<br/>
                                            3.考试途中，若浏览器关闭或电脑关机，请及时重新登录该系统继续作答。<br/>
                                            以上事项有不清楚的地方和网上考试期间登录有问题，请与监考老师联系。</b><br/> <br/>
                                    </div>
                                </div>

                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <div class="row-fluid">
                                    <div class="span12" >
                                        <input  ref="agree"  id="CheckBox" type="checkbox" name="agree" value="1" style="display:inline"/><label style="display:inline" for="CheckBox">已阅读考试须知，同意遵守各项条款</label>
                                    </div>
                                </div>
                                <br/> <br/>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <Button id="examButtion"  @click="exam"  ref="exam"  type="submit"  class="btn">参加考试
                                        </Button>
                                    </div>

                                    <div class="span6">
                                        <Button  id="makeUpButtion" @click="exam" ref="makeup"   type="submit" class="btn">
                                            参加补考
                                        </Button>
                                    </div>

                                </div>

                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <input id="examState" type="hidden" :value="studentInfo.makeUpState"/>
    <input id="makeUpState" type="hidden" value="${user_in_session.makeUpState }"/>
</div>
<script src="../layui/layui.js"></script>
<script type="text/javascript">
    $.ajax({
        type: "GET",
        url: projectName+"/examinee/examAndStuInfo.do",
        async: false,
        dataType: "json",
        success: function (res) {
            window.user=res.user;
            window.exam=res.exam;
            var totalScore = exam.radioNum*exam.radioScore/*+  user.saqNum * user.saqScore*/+ exam.judgeNum*exam.judgeScore+ exam.fillNum*exam.fillScore;
            console.log(totalScore);
            console.log(exam);
               localStorage.setItem("totalScore",totalScore);
        }
    });
    var layer;
    layui.use(['layer'],function () {
        layer=layui.layer;
    })
    // Vue.prototype.$axios=axios;
    const vm = new Vue({
        el:"#app",
        data:{
            studentInfo:user,
            examInfo:exam
        },
        created() {


        },
        mounted() {
            //1是开卷，0是闭卷
            window.localStorage.setItem("openOrClose",this.examInfo.openOrClose)
            if(this.studentInfo.examState==0||this.studentInfo.examState==1){
                $("#makeUpButtion").attr("disabled",true)
                $("#makeUpButtion").css("cursor","not-allowed")

            }else{
                $("#examButtion").attr("disabled",true)
                $("#examButtion").css("cursor","not-allowed")
            }
        },
        methods: {
            /*getStudentInfo(){
                axios.get("/examinee/examAndStuInfo.do")
                    .then(res=>{
                        this.studentInfo=res.data.user
                        console.log(this.studentInfo)
                    })
                    .catch(error=>{
                        console.log(error)
                    })
            },*/
            exam(){
                if(this.$refs.agree.checked==false){
                    layer.msg("请先阅读并勾选考试须知！");
                    return false;
                }
                window.location.href="exam.html";
            }
        },

    })
    $(function () {
        $("#logout").click(function () {
            $.post(projectName+"/user/logout.do", {}, function (data) {
                window.location.href = data.replace(/"/g, "");
            });
        });
    });
    //防止页面后退
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
        history.pushState(null, null, document.URL);
    });
</script>

</body>
</html>